package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.StrategyContent;
import cn.wolfcode.luowowo.article.mapper.StrategyContentMapper;
import cn.wolfcode.luowowo.article.service.IStrategyContentService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Administrator on 2019/7/8.
 */
@Service
public class StrategyContentServiceImpl implements IStrategyContentService{
    @Autowired
    private StrategyContentMapper strategyContentMapper;

    @Override
    public void saveOrUpdate(StrategyContent strategyContent) {
        if (strategyContent.getId()==null){
            strategyContentMapper.insert(strategyContent);
        }else {
            strategyContentMapper.updateByPrimaryKey(strategyContent);
        }
    }

    @Override
    public void delete(Long id) {
        strategyContentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public StrategyContent get(Long rid) {
        return strategyContentMapper.selectByPrimaryKey(rid);
    }
}
